package com.yidong.laidian.laidian.exception;

import com.yidong.laidian.laidian.until.ResultVoUtils;
import com.yidong.laidian.laidian.vo.ResultVO;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

@ControllerAdvice
public class LaiDianExceptionHandler {

    @ExceptionHandler(value = ApiViewException.class)
    @ResponseBody
    public ResultVO<Object> apiViewException(ApiViewException e) {
        return ResultVoUtils.error(e.getCode(),e.getMessage());
    }


}
